// var Api = "http://songyujianiu.qicp.vip/";
var Api = "http://192.168.5.20:9000";
new Vue({
  el: "#app",
  data: function () {
    return {
	  loginName: "",
      equipId: "",
      equipName: "",
	  addTime: "",
    };
  },
  created: function () {},
  methods: {
	  retu(){
		  window.location.href ="index.html";
	  },
    //
    // 保存
    add: function () {
      let that = this;
       // alert("11");
      console.log("add");

      const par = new URLSearchParams();
	  par.append("loginName", that.loginName);
      par.append("equipId", that.equipId);
      par.append("equipName", that.equipName);
	  par.append("addTime",that.addTime);
      axios({
        method: "post",
        url: Api + "/equip/addEquip",
        params: par,
      }).then(function (res) {
        console.log(res);
        if (res.data.code == "101") {
          layer.msg("添加成功", { time: 1000 });
          window.location.href = "equipList.html";
        } else {
          layer.msg(res.data.message, { time: 1000 });
        }
      });
    },
    //  弹出框的全选
    handleSelectionChange(val) {
      console.log(val);
      var arr = [];
      let that = this;
      for (const item in val) {
        arr.push(val[item].userId);
      }
      that.userId = arr;
    },
    //  分页
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
  },
});
